<html>
<body>

<!--include the gamelib files-->
<script language="Javascript" src="gamelib/gamelib_keyboard.js"></script>
<script language="Javascript" src="gamelib/gamelib_core.js"></script>

<!--include the raycaster object-->
<script language="javascript" src="raycast.js"></script>

<script language="javascript">

//setting up the raycaster.

//create a map 0s are floors..  >0 is wall height.
var map=new Array(1.0,1.0,1.0,1.0,1.0,
                                1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,4.0,0.0,1.0,
								1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,3.0,0.0,1.0,
								1.0,0.0,2.0,0.0,1.0,
								1.0,0.0,1.2,0.0,1.0,
								1.0,0.0,0.5,1.2,1.0,
								1.0,0.0,1.2,0.0,1.0,
                                1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,0.0,0.0,1.0,
								1.0,0.0,0.0,0.0,1.0,
								1.0,1.0,1.0,1.0,1.0);

//create a texture array
var myTextures=new Array("texture1.bmp","texture2.bmp")

//make the map object
var myMap=new maze();

//height, width, map array
myMap.setmap(16,5,map);

//set the controls
myMap.setcontrols("W","S","A","D");

//set the players movement (rotation speed, walking speed)
myMap.setspeed(10,15)

//load the textures and set the renderer  [textures on/off,fogcolor,draw distance,texture filtering], note this stuff doesn't do anything yet
myMap.textures(myTextures);
myMap.setrenderer(true,"ff99ff",20,false);

//alert(myMap.peek(20,20));
//create a function to call the raycaster object functions
function raycaster()
{
var time=setTimeout("raycaster()",50);
    //check if the players position has changed, if it has redraw the screen.
	if(myMap.controls())myMap.cast();

	//recall this function
	
}

//run the raycaster.
raycaster();
</script>

</body>
</html>